﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>

<asp:Content ID="indexTitle" ContentPlaceHolderID="TitleContent" runat="server">
	Home Page
</asp:Content>
<asp:Content ID="indexContent" ContentPlaceHolderID="MainContent" runat="server">
	<% if (!Request.IsAuthenticated)
	{ %>
	<div class="pagetitle">
		<h1>
			Log in
		</h1>
	</div>
	<div class="pagecontent">
		<p>
			You must
			<%= Html.ActionLink( "log in", "LogOn", "Account", null, null ) %>
			to use NMailer
		</p>
	</div>
	<% }
	else
	{ %>
	<div class="pagetitle">
		<h1>
			Your applications
		</h1>
	</div>
	<div class="pagecontent">
		<p class="menu">
			<%= Html.ActionLink( "New application", "New", "Application" ) %>
			|
			<%= Html.ActionLink( "Change password", "ChangePassword", "Account", null, null ) %>
		</p>
		<ul>
			<% foreach (var a in (ViewData["Apps"] as List<Mailer.Model.Types.Application>)
	   )
	  { %>
			<li>
				<%= Html.ActionLink( a.Name+" ", "View", "Application", new { Id = a.ID }, null ) %>
			</li>
			<% } %>
		</ul>
	</div>
	<% } %>
</asp:Content>
